// 278.第一个错误的版本

package Leetcode;

/* The isBadVersion API is defined in the parent class VersionControl.
      boolean isBadVersion(int version); */

// class Solution_278 extends VersionControl {
//     public int firstBadVersion(int n) {
//         if (n == 1)
//             return 1;
//         int left = 1, right = n;
//         while (left <= right) {
//             int mid = left + (right - left) / 2;
//             if (isBadVersion(mid) == false)
//                 left = mid + 1;
//             else
//                 right = mid - 1;
//         }
//         return left;
//     }
// }